<meta charset="utf-8"/>
<?php
include("../connectDB.php");
		
		$masv 			= $_POST["txt_masv"];
		$hoten 			= $_POST["txt_hoten"];
		$ngaysinh 		= $_POST["txt_ngaysinh"];
		$gioitinh 		= $_POST["gender"];
		$quequan 		= $_POST["txt_quequan"];
		$dantoc 		= $_POST["dantoc"];
		$lop 			= $_POST["txt_lop"];
		$khoa 			= $_POST["txt_khoa"];
		$nienkhoa 		= $_POST["txt_nienkhoa"];
		$socm 			= $_POST["txt_socm"];
		$sodt 			= $_POST["txt_dienthoai"];
		$anh 			= $_FILES['img']['name'];
		
$sql = "UPDATE `sinhvien` SET 
`hoten` = '$hoten',
`ngaysinh` = '$ngaysinh',
`gioitinh` = '$gioitinh',
`quequan` = '$quequan',
`dantoc` = '$dantoc',
`lop` = '$lop',
`khoa` = '$khoa',
`nienkhoa` = '$nienkhoa',
`socm` = '$socm',
`sodt` = '$sodt',
`anh` = '$anh' WHERE `masv` =$masv;

";
		
		//echo $sql;
	if(mysql_query($sql))
	{

		
?>
		<script language = "javascript">
		alert("Sửa thành công!");
		self.location = "../?mod=sinhvien&do=dssv";
		</script>
		<?php
			}
			else
			{
		?>
		<script language = "javascript">
		alert("Sửa thất bại");
		//self.location = "../?mod=sinhvien&do=edit&sv_ID=<?php echo $masv ?>";
		</script>
		<?php		
	}
	move_uploaded_file($_FILES['img']['tmp_name'],'images/'.$anh);
?>
